/**
 * Whale.java
 * Subclasses of Aqualife are fish, and whale.
 *
 * Whale has an attribute that specifies whether the whale is a blue whale or
 * a killer whale. If the whale is a blue whale, it eats veggies,
 * if it is a killer whale it eats meat.
 *
 * The procreates method prints that whales are mammals.
 *
 * Override the breathes method from the parent class.
 * This method must print ‘These mammals breathe above water’.
 *
 *  @author  John Thomason
 *    Date:  Nov 22, 2008
 *  Course:  CS222 Java II
 * Seminar:  3
 *  Assign:  Mid Term Exam
 */


/**
 * Whale Class
 */
public class Whale
extends Aqualife {


//INSTANCE VARS

    public enum Species { BLUE, KILLER };
    private Species spec;


//CONSTRUCTORS

    /**
     * No-Arg Consturctor
     * Constructs a default Blue whale
     */
    public Whale(){
        this(Species.BLUE, "Snuggles", 1);
    }

    /**
     * Constructs a whale from user provided specifications
     *
     * @param spec  The whale species [Blue | Killer]
     * @param name  The name of the whale
     * @param age   The age of the whale
     */
    public Whale(Species spec, String name, Integer age){
        super(name,age);
        this.spec = spec;
    }


//CONCRETE IMPLEMENTATIONS

    /**
     * eat()
     * What a whale eats based on species
     *
     * @return  A string of what the whale eats
     */
    public String eat(){
        String e = "";
        switch(spec){
            case BLUE:
                e = "Blue whale eats veggies";
                break;
            case KILLER:
                e = "Killer whale eats meat";
                break;
        }//switch()
        return e;
    }//eat()

    /**
     * procreates()
     * What the whale spawns
     *
     * @return  A string of what a whale spawns
     */
    public String procreates(){
        return "Whales are mammals, and have little Whale'ettes!";
    }//procreates()

    
//OVERRIDDEN METHODS

    /**
     * breathes()
     * How a whale breathes
     *
     * @return  A string of how a whale breathes
     */
    @Override
    public String breathes(){
        return "These mammals breathe above water.";
    }//breathes()

    /**
     * toString()
     * A string describing this whale
     *
     * @return  A string describing this whale
     */
    @Override
    public String toString(){
        return String.format("\"%s\" the %s, and is %d %s old.\n  %s\n  %s\n",
                getName(), eat(), getAge(), (getAge() != 1)?"years":"year",
                breathes(), procreates());
    }//toString()

}//End Whale Class
